package com.example.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.order.service.OrderService;
import com.example.platformsharedcommon.exception.RRException;
import com.example.platformsharedcommon.util.ResponseResult;
import com.github.pagehelper.PageInfo;

/**
 * 测试聚合调用底层是否能调通
 * @author Dhjie
 *
 */
@RestController
public class testController {
	@Autowired
	private OrderService orderService;
	
	@GetMapping("test")
	public String test() {
		return "hello Cloud";
	}
	
	@GetMapping("listOrder")
	public ResponseResult listOrder() {
		try {
			return ResponseResult.ok(PageInfo.of(orderService.listOrder()));
		} catch (Exception e) {
			return ResponseResult.error(e.getMessage());
		}
	}

}
